// Copyright (c) 2020 Presto Labs Pte. Ltd.
// Author: donggu

#include "coin2/base/time.h"
#include "coin2/exchange/base/symbology/product.h"
#include "coin2/exchange/factory/symbology/product.h"

using coin2::exchange::symbology::ProductConfig;
using coin2::exchange::symbology::ProductRequest;

int main() {
  const char* meas[] = {"Futures.Huobi.v1", "Futures.Okex.v3"};
  for (auto& mea : meas) {
    ProductConfig config;
    config.add_norms("LTC-USD.WEEK");
    config.add_norms("LTC-USD.NEXT_WEEK");
    config.add_norms("LTC-USD.QUARTER");
    auto products = ProductRequestsFromConfig(mea, config);

    std::cout << "========== " << mea << " ==========\n";
    for (auto& prod : products) {
      std::cout << "             absolute_norm: " << prod->absolute_norm() << std::endl;
      std::cout << "       order_native_symbol: " << prod->order_native_symbol() << std::endl;
      std::cout << "             relative_norm: " << prod->relative_norm() << std::endl;
      std::cout << "        feed_native_symbol: " << prod->feed_native_symbol()
                << std::endl;
      std::cout << "       base  currency: " << prod->base().currency() << std::endl;
      std::cout << " base native_currency: " << prod->base().native_currency() << std::endl;
      std::cout << " base    rep_currency: " << prod->base().rep_currency() << std::endl;
      std::cout << "       quote currency: " << prod->quote().currency() << std::endl;
      std::cout << "quote native_currency: " << prod->quote().native_currency() << std::endl;
      std::cout << "quote    rep_currency: " << prod->quote().rep_currency() << std::endl;
      std::cout << std::endl;
    }
  }
  return 0;
}
